#ifndef _PWM_H_
#define _PWM_H_
#include <Arduino.h>
//uint8_t pin_speed;GPIO
//uint8_t FREQ;频率
//uint8_t CHANNEL;通道 
//uint8_t RESOLUTION;分辨率
//这个pwm的也没有封装
typedef struct Speed_Handle
{
    uint8_t pin_speed;//GPIO
    uint8_t FREQ;//频率
    uint8_t CHANNEL;//通道 
    uint8_t RESOLUTION;//分辨率
}Speed_Handle;
//uint8_t pin_servo;GPIO
//uint8_t FREQ;频率
//uint8_t CHANNEL;通道
//uint8_t RESOLUTION;分辨率
typedef struct Servo_Handle
{
    uint8_t pin_servo;//GPIO
    uint8_t FREQ;//频率
    uint8_t CHANNEL;//通道
    uint8_t RESOLUTION;//分辨率
}Servo_Handle;
extern Servo_Handle SERVOHANDLE;
void speed_init(const Speed_Handle&speedhandle);
void servo_init(const Servo_Handle&servohandle);
int calculateServo(int degree);
#endif